'use strict'

class voice {
    constructor() {
        this.param = '/'
    }

    async post(c) {
        let f = c.getFile('voice')
        if (!f) {
            return c.status(400).send('file not found')
        }
        let fname = c.helper.makeName(f.filename)
        await c.moveFile(f, `${c.service.voicePath}/${fname}`)
        c.status(200).send(`https://wx.xxmtcds.top:2333/voice/${fname}`)
    }
}

module.exports = voice